// 公共地址
const BASE_URL = "http://localhost:8080/";

/**
 * 获取每个地区的平均工资
 */
 function getAreaAvgWageList() {
  return new Promise((resolve, reject) => {
    $.get(BASE_URL+"recruit/list/area/avg/wage", function (data, status) {
      // 获取服务端数据
      resolve(data);
    })
  })
}

/**
 * 获取学历占比
 */
function getEducationAnalyseList() {
  return new Promise((resovle,reject) => {
    $.get(BASE_URL+"recruit/list/education/analyse", function (data, status) {
      // 获取服务端数据
      resolve(data);
    })
  })
}

/**
 * 获取每个地区的招聘人数
 */
function getRecruitNumList() {
  return new Promise((resovle, reject) => {
    $.get(BASE_URL+"recruit/list/recruit/num", (data, status) => {
      // 获取服务端数据
      resovle(data);
    })
  })
}

/**
 * 每个地区的平均工资
 */
function getAreaAvgWage() {
  return new Promise((resovle, reject) => {
    $.get(BASE_URL+"recruit/get/area/avg/wage", (data, status) => {
      // 获取服务端数据
      resovle(data);
    })
  })
}


/**
 * 学历分布分类
 */
function getEducationAnalyse() {
  return new Promise((resovle, reject) => {
    $.get(BASE_URL+"recruit/get/education/analyse", (data, status) => {
      // 获取服务端数据
      resovle(data);
    })
  })
}

/**
 * 按照区域获取各经验类型和人数
 */
function getExperienceTypeAnalyseList() {
  return new Promise((resovle, reject) => {
    $.get(BASE_URL+"recruit/list/experience/type/analyse", (data, status) => {
      // 获取服务端数据
      resovle(data);
    })
  })
}

/**
 * 获取每个福利类型对应的数量
 */
function getWelfareAnalyseList() {
  return new Promise((resovle, reject) => {
    $.get(BASE_URL+"recruit/list/welfare/analyse", (data, status) => {
      // 获取服务端数据
      resovle(data);
    })
  })
}
export {
  getAreaAvgWage,
  getAreaAvgWageList,
  getEducationAnalyse,
  getEducationAnalyseList,
  getRecruitNumList,
  getExperienceTypeAnalyseList,
  getWelfareAnalyseList
}